.TH std::lconv 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::lconv \- std::lconv

.SH Synopsis
   Defined in header <clocale>
   struct lconv;

   The class std::lconv contains numeric and monetary formatting rules as defined by a
   C locale. Objects of this struct may be obtained with std::localeconv. The members
   of std::lconv are values of type char and of type char*. Each char* member except
   decimal_point may be pointing at a null character (that is, at an empty C-string).
   The members of type char are all non-negative numbers, any of which may be CHAR_MAX
   if the corresponding value is not available in the current C locale.

.SH Member objects

.SH Non-monetary numeric formatting parameters

   char* decimal_point the character used as the decimal point
                       \fI(public member object)\fP
                       the character used to separate groups of digits before the
   char* thousands_sep decimal point
                       \fI(public member object)\fP
   char* grouping      a string whose elements indicate the sizes of digit groups
                       \fI(public member object)\fP

.SH Monetary numeric formatting parameters

   char* mon_decimal_point the character used as the decimal point
                           \fI(public member object)\fP
                           the character used to separate groups of digits before the
   char* mon_thousands_sep decimal point
                           \fI(public member object)\fP
   char* mon_grouping      a string whose elements indicate the sizes of digit groups
                           \fI(public member object)\fP
   char* positive_sign     a string used to indicate non-negative monetary quantity
                           \fI(public member object)\fP
   char* negative_sign     a string used to indicate negative monetary quantity
                           \fI(public member object)\fP

.SH Local monetary numeric formatting parameters

   char* currency_symbol the symbol used for currency in the current C locale
                         \fI(public member object)\fP
                         the number of digits after the decimal point to display in a
   char frac_digits      monetary quantity
                         \fI(public member object)\fP
                         1 if currency_symbol is placed before non-negative value, 0 if
   char p_cs_precedes    after
                         \fI(public member object)\fP
                         1 if currency_symbol is placed before negative value, 0 if
   char n_cs_precedes    after
                         \fI(public member object)\fP
                         indicates the separation of currency_symbol, positive_sign,
   char p_sep_by_space   and the non-negative monetary value
                         \fI(public member object)\fP
                         indicates the separation of currency_symbol, negative_sign,
   char n_sep_by_space   and the negative monetary value
                         \fI(public member object)\fP
                         indicates the position of positive_sign in a non-negative
   char p_sign_posn      monetary value
                         \fI(public member object)\fP
                         indicates the position of negative_sign in a negative monetary
   char n_sign_posn      value
                         \fI(public member object)\fP

.SH International monetary numeric formatting parameters

                           the string used as international currency name in the
   char* int_curr_symbol   current C locale
                           \fI(public member object)\fP
                           the number of digits after the decimal point to display in
   char int_frac_digits    an international monetary quantity
                           \fI(public member object)\fP
   char int_p_cs_precedes  1 if int_curr_symbol is placed before non-negative
   \fI(C++11)\fP                 international monetary value, 0 if after
                           \fI(public member object)\fP
   char int_n_cs_precedes  1 if int_curr_symboll is placed before negative
   \fI(C++11)\fP                 international monetary value, 0 if after
                           \fI(public member object)\fP
   char int_p_sep_by_space indicates the separation of int_curr_symbol, positive_sign,
   \fI(C++11)\fP                 and the non-negative international monetary value
                           \fI(public member object)\fP
   char int_n_sep_by_space indicates the separation of int_curr_symbol, negative_sign,
   \fI(C++11)\fP                 and the negative international monetary value
                           \fI(public member object)\fP
   char int_p_sign_posn    indicates the position of positive_sign in a non-negative
   \fI(C++11)\fP                 international monetary value
                           \fI(public member object)\fP
   char int_n_sign_posn    indicates the position of negative_sign in a negative
   \fI(C++11)\fP                 international monetary value
                           \fI(public member object)\fP

   The characters of the C-strings pointed to by grouping and mon_grouping are
   interpreted according to their numeric values. When the terminating '\\0' is
   encountered, the last value seen is assumed to repeat for the remainder of digits.
   If CHAR_MAX is encountered, no further digits are grouped. the typical grouping of
   three digits at a time is "\\003".

   The values of p_sep_by_space, n_sep_by_space, int_p_sep_by_space, int_n_sep_by_space
   are interpreted as follows:

   0 no space separates the currency symbol and the value
   1 sign sticks to the currency symbol, value is separated by a space
   2 sign sticks to the value. Currency symbol is separated by a space

   The values of p_sign_posn, n_sign_posn, int_p_sign_posn, int_n_sign_posn are
   interpreted as follows:

   0 parentheses around the value and the currency symbol are used to represent the
     sign
   1 sign before the value and the currency symbol
   2 sign after the value and the currency symbol
   3 sign before the currency symbol
   4 sign after the currency symbol

.SH Example



// Run this code

 #include <clocale>
 #include <iostream>

 int main()
 {
     std::setlocale(LC_ALL, "ja_JP.UTF-8");
     std::lconv* lc = std::localeconv();
     std::cout << "Japanese currency symbol: " << lc->currency_symbol
               << '(' << lc->int_curr_symbol << ")\\n";
 }

.SH Output:

 Japanese currency symbol: ￥(JPY )

.SH See also

   localeconv queries numeric and monetary formatting details of the current locale
              \fI(function)\fP
   numpunct   defines numeric punctuation rules
              \fI(class template)\fP
              defines monetary formatting parameters used by std::money_get and
   moneypunct std::money_put
              \fI(class template)\fP
   C documentation for
   lconv
